package com.pkk.penguin.frame.know.boot.service.zhiyi;

import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.pkk.penguin.frame.know.boot.apis.zhiyi.SynchApi;
import java.net.HttpCookie;
import java.util.HashMap;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.springframework.stereotype.Service;

/**
 * @description: 之易同步业务
 * @author: peikunkun
 * @create: 2020-05-20 17:27
 **/
@Slf4j
@Service
public class ZhiyiSynchService {


  @Test
  public void Administrator_17_20200520172746() {
    System.out.println("欢迎使用单元测试方法【Administrator_17()_20200520172746】");
    System.out.println("此方法测试描述：【】");

    String baseUrl = "http://hszadmin.mxingkong.net";
    String loginUrl = baseUrl.concat("/admin/login.do");
    final HttpRequest post = HttpUtil.createPost(loginUrl);
    final HashMap<String, Object> param = new HashMap<>();
    param.put("passNo", "peikunkun");
    param.put("passPwd", "admin");
    final HttpResponse execute = post.form(param).execute();
    final String body = execute.body();
    final HttpCookie jsessionid = execute.getCookie("JSESSIONID");
    final String value = jsessionid.getValue();
    System.out.println(body);

    String dictUrl = baseUrl.concat("/admin/findDicts.do");
    final HashMap<String, Object> param1 = new HashMap<>();
    param1.put("status", "1");
    final HttpResponse execute1 = HttpUtil.createPost(dictUrl).form(param1).execute();
    final String body1 = execute1.body();
    System.out.println(body1);


  }

  @Test
  public void Administrator_38_20200520173207() {
    System.out.println("欢迎使用单元测试方法【Administrator_38()_20200520173207】");
    System.out.println("此方法测试描述：【】");


  }


}
